package com.vf.admin.client.controller.ticket;

import com.vf.admin.client.common.ClientBaseController;
import com.vf.admin.client.common.RedisKeys;
import com.vf.admin.client.service.AppUserService;
import com.vf.admin.common.entity.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

import static com.vf.admin.client.common.ClientConstants.client_toke;

/**
 * <p>Title : </p>
 * <p>Description : </p>
 * <p>DevelopTools : IDEA</p>
 * <p>DevelopSystem : Windows11</p>
 *
 * @Author : zxw
 * @Date 2023/8/22 16:12
 */
@RestController
@RequestMapping("/app/tickUserInfo")
public class TicketUserInfoController extends ClientBaseController {

    @Resource
    private AppUserService appUserService;


    /**
     * 获取价格信息
     * @return
     */
    @RequestMapping(value = "/info")
    @ResponseBody
    public Result info() {
        //判断用户是否登录
        Integer userId = (Integer) redisUtil.get(RedisKeys.userToken + request.getHeader(client_toke));

        Map<String,Integer> map = new HashMap<>();
        Integer windowTicket = appUserService.gets(userId).getWindowTicket();
        map.put("windowTicket",windowTicket);
        return this.sucessJSON(map);

    }
}
